import { request } from '@/apis';
import { addPrefix } from '@/utils/helper';
import { type ResourceUtilizationParams } from './types';

const prefixUrl = '/ep-query';

const Api = {
  /** 表格数据 */
  getData: '/v1/resourcesUtilization/getSolidWasteRecycle',
  /** 企业类型 */
  getProfessionalField: '/v1/resourcesUtilization/getProfessionalField',
  /** 认定批次 */
  getBatchTag: '/v1/resourcesUtilization/getBatchTag',
  /** 状态 */
  getRevocationTag: '/v2/screen/getRevocationTag',
  /** 类型 */
  getTypeTag: '/v1/resourcesUtilization/getProfessionalField',
  /** 获取废弃电子表格数据 */
  getElecData: '/getDisposalQualification',
  /** 获取产品类别 */
  getProductType: '/v1/resourcesUtilization/getProductType'
};

addPrefix(Api, prefixUrl);

export * from './types';

/** 获取表格数据 */
export const getData = (params: ResourceUtilizationParams) => request.get({ url: Api.getData, params });

/** 获取企业类型 */
export const getProfessionalField = (type: number) => request.get({ url: Api.getProfessionalField, params: { type } });

/** 获取认定批次 */
export const getBatchTag = (type: number) => request.get({ url: Api.getBatchTag, params: { type } });

/** 获取状态 */
export const getRevocationTag = () => request.get({ url: Api.getRevocationTag });

/** 获取类型 */
export const getTypeTag = (type: number) => request.get({ url: Api.getTypeTag, params: { type } });

/** 获取废弃电子表格数据 */
export const getElecData = (params: ResourceUtilizationParams) => request.get({ url: Api.getElecData, params });

/** 获取产品类别 */
export const getProductType = (type: number) => request.get({ url: Api.getProductType, params: { type } });
